package org.maitaole.controller;

import org.maitaole.model.Result;
import org.maitaole.service.IEvaluateBaseInfoService;
import org.maitaole.service.ITbGoodService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/evaluate-base-info")
@CrossOrigin("*")
public class EvaluateBaseInfoController {

    @Resource
    private IEvaluateBaseInfoService evaluateBaseInfoService;

    @Resource
    private ITbGoodService iTbGoodService;

    @GetMapping
    public Result getAllEvaluateBaseInfo(Integer goodsId) {
        return Result.buildSuccess(evaluateBaseInfoService.getAll(goodsId));
    }

    @GetMapping("/price")
    public Result getTbGoodById(Integer goodsId){
        return Result.buildSuccess(iTbGoodService.getTbGoodById(goodsId));
    }
}
